import { axios_get, axios_post, req_action_ } from "@/plugins/request.js";
import { func } from "vue-types";

export function v2run(param) {
  return axios_post("/v2/runstatusV2", param);  //{subProjectId: 20220901}
};



export function base64(param) {
  return axios_get('/v3/getcode', param)
}


export function storage_list(param) {
  return axios_post("/v3/subprojectinfo", param)
}

/*5MW*/
export function login(param) {
  return axios_post("/login/doLogin", param)
}
/*获取所有站点*/
export function site_info_all(param) {
  return axios_post("/project/projectInfo", param)
}



/*根据devicemodle查询点位和点位名*/
export function mode_name(param) {
  return axios_post("/deviceTag/devicetag", param)
}

export function deviceType(param) {
  return axios_post("/device/getSiteDeviceModel", param)
}
export function deviceTypeList(param) {
  return axios_post("/device/getDeviceTagInfo", param)
}

export function user_query(param) {
  return axios_post("/user/queryUser", param)
}

export function user_edit(param) {
  return axios_post("/user/updateUser", param)
}

export function user_add(param) {
  return axios_post("/user/addUser", param)
}


export function user_del(id) {
  return axios_post("/user/delUser/" + id)
}

/*日志*/
export function log_list(param) {
  return axios_post("/oplog/pagequery", param)
}

export function log_export(param) {
  return axios_post("/export-csv", param)
}

/*历史数据*/
export function history_curve(param) {
  return axios_post("/listHistoryByIdTagCode", param)
}

//历史数据，按小时统计的柱状图
export function history_bar(param) {
  return axios_post("/queryEpiAndEpe", param)
}
/*故障告警页面*/
export function project_error_list() {

}

export function project_error_month() {

}


/*---储能策略--*/

export function get_policy(param) {
  return axios_post("/strategy/projectconfig/get", param)
}
export function update_auto(param) {
  return axios_post("/strategy/projectconfig/updateauto", param)
}
/*修改策略---*/
export function update_policy(param) {
  return axios_post("/strategy/projectconfig/updatep", param)
}

/*根据点位和tagcode 查询曲线*/
export function tag_code_curve(param) {
  return axios_post("/api/listHistoryByIdTagCode", param)
}

export function set_protect(param) {
  return axios_post('/strategy/projectconfig/updateconfig', param)
}
export function policy_copy(param) {
  return axios_post('/strategy/projectconfig/copy', param)
}

export function project_p(param) {
  return axios_post('/real/emsP', param)
}

export function under_zhiling(param) {
  return axios_post('/strategy/projectconfig/control', param)
}

/*系统故障*/
export function error_query(param) {
  return axios_post('/v3/faultdata/query', param)
}
export function error_month(param) {
  return axios_post('/v3/faultdata/statistics', param)
}


/*获取站点下的设备*/
export function site_device_list(param) {
  return axios_get('/device/getDeviceBySiteId', param)
}


export function line_data(param){
  return axios_post('/listHistoryByIdTagCode', param)
}

/*获取项目信息包括密码*/
export function get_base(param){
  return axios_get("/project/getProject",param)
}

/*修改操作密码*/
export function update_op_pass(param){
  return axios_post("/project/updatePwd/",param)
};


export function update_op_pass_hei(param){
  return axios_post("/project/updateBlackPwd/",param)
}

export function set_xietong(param){
  return axios_post("/strategy/projectconfig/updateRunStatus",param)
}


/*站点管理*/
export function site_query_page(param){
  // return axios_post("/site/querySite",param) //404废弃
  return axios_post("/site/allSite",param) //
}

/*--协同--*/
export function site_update_xietong(param){
  return axios_post("/site/updateModel",param)
}


export function site_update_auto(param){
  return axios_post("/site0000/updateModel",param)
}

export function storage_update_xietong(param){

}

export function storage_update_auto(param){
  
}

/*获取电芯数据*/

export function cell_datas(param){
  return axios_post("/getDxTagValByDeviceParentNo",param)
}

export function cell_query_guize(subProjectId){
  return axios_post(`/subProject/findBySubProjectId/${subProjectId}`)
}

export function bms_get_sbmu_no(parentDeviceNo){
  return axios_post(`/device/getNextLevelDevice/${parentDeviceNo}`)
}


/*充放电量统计*/
export function epe_epi_data(param){
  return axios_post("/statistic/epiEpeStatistics",param)
}

export function day_epe_epi_hour_multi(param){

  return axios_post('/queryEpiAndEpe',param)
}

export function site_model(param){

  return axios_post('/site/updateStrategyModel',param)
}

export function site_xietong(param){

  return axios_post('/site/updateModel',param)
}

export function get_bms_no(deviceNo){  //查询上级设备的deviceNo
  return axios_post('/device/getParentDevice/'+deviceNo)
}